package com.sky.ok.controller;

import com.sky.ok.common.ResponseBean;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author 余心乐sky
 * @create 2018-12-20 15:41
 **/
@RestController
public class Logout {

    @RequestMapping("/logout")
    public ResponseBean logout(HttpSession session) {
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return new ResponseBean(200, "logout success", "成功退出");
    }

}
